#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main()
{
	int n = 0;
	while (scanf("%d",&n) != EOF)
	{
		for (int i = 1; i <= n; i++)
		{
			printf("* ");
		}
		printf("\n");

		for (int i = 1; i <= n - 2; i++)
		{
			printf("*");

			for (int j = 1; j <= 2 * n - 3; j++)
			{
				printf(" ");
			}

			printf("*\n");

		}

		for (int i = 1; i <= n; i++)
		{
			printf("* ");
		}
	
		printf("\n");
	}
	return 0;
}


